package com.imooc.order.server.controller;


import com.imooc.order.server.dataobject.TestModel;
import com.imooc.product.client.ProductClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: wangjunjie 21:49$ 2018/5/27$
 * @Description:$params$
 * @Version: 1.0.0
 * @Modified By: xxx 21:49$ 2018/5/27$
 */
@Controller
@RequestMapping("/test")
@RefreshScope
public class TestController {

    @Value("${env}")
    private String env;

    @Autowired
    private ProductClient productClient;

    @RequestMapping(value = "config")
    @ResponseBody
    public String testConfig() {
        return env;
    }

    @RequestMapping("/order/test")
    @ResponseBody
    public String testMsg() {
        String msg = productClient.testMsg("chengxiaohong");
        return msg;
    }
}
